<?php
/*
 * @ https://EasyToYou.eu - IonCube v11 Decoder Online
 * @ PHP 7.2 & 7.3
 * @ Decoder version: 1.1.6
 * @ Release: 10/08/2022
 */

// Decoded file for php version 71.
namespace app\Common\model;

class LongbingCardCount extends \app\BaseModel
{
    protected $name = "longbing_card_count";
    public function getCount($filter)
    {
        $result = $this->where($filter)->find();
        if(!empty($result)) {
            $result = $result->toArray();
        }
        return $result;
    }
    public function getCountNum($filter)
    {
        $result = $this->where($filter)->count();
        return $result;
    }
    public function getTodaylist($where)
    {
        return $this->where($where)->whereDay("create_time")->count();
    }
    public function getCreateTimeAttr($value)
    {
        return date("Y-m-d H:i:s", $value["create_time"]);
    }
    public function getYesterdaylist($where)
    {
        $data = $this->alias("a")->join("longbing_card_collection b", "a.to_uid = b.to_uid && a.uniacid = b.uniacid", "left")->field("a.to_uid,count(a.to_uid) as number,a.create_time")->where($where)->group("a.to_uid")->whereDay("a.create_time")->select()->toArray();
        print_r($this->getLastSql());
        exit;
    }
}

?>